Class LTVImpl

java.lang.Object
com.cisco.pt.impl.LTVImpl
All Implemented Interfaces:
LTV
Direct Known Subclasses:
AuthChallengeLTV, AuthRequestLTV, AuthResponseLTV, AuthStatusLTV, DisconnectLTV, IPCErrorLTV, IPCEventLTV, IPCEventSubscriptionLTV, IPCMessageLTV, IPCResponseLTV, KeepAliveLTV, MultiUserMessage

public abstract class LTVImpl extends Object implements LTV
Base class for all LTV implemenations
Author:
packettracerexapps@external.cisco.com
  • Field Details

    • logger

      protected static org.apache.commons.logging.Log logger
  • Constructor Details

    • LTVImpl

      public LTVImpl()
  • Method Details

    • getLength

      public int getLength()
      Specified by:
      getLength in interface LTV
      Returns:
      message length
    • getType

      public int getType()
      Specified by:
      getType in interface LTV
      Returns:
      message type
    • getValue

      public Value getValue()
      Specified by:
      getValue in interface LTV
      Returns:
      message payload
    • setLength

      public void setLength(int length)
      Specified by:
      setLength in interface LTV
      Parameters:
      length - int
    • setType

      public void setType(int type)
      Specified by:
      setType in interface LTV
      Parameters:
      type - int
    • setValue

      public void setValue(Value value)
      Specified by:
      setValue in interface LTV
      Parameters:
      value - Value
    • encodeTypeAndPayload

      public void encodeTypeAndPayload(EncodedBuffer buff)
      Specified by:
      encodeTypeAndPayload in interface LTV
      Parameters:
      buff - The EncodedBuffer that this object should encode itself into
    • hasResponse

      public boolean hasResponse()
      Specified by:
      hasResponse in interface LTV
      Returns:
      true if the message generates a response from Packet Tracer
    • isResponse

      public boolean isResponse()
      Specified by:
      isResponse in interface LTV
      Returns:
      true if the message is a response sent from Packet Tracer
    • isEvent

      public boolean isEvent()
      Specified by:
      isEvent in interface LTV
      Returns:
      true if the message is an event sent from Packet Tracer
    • isMuMessage

      public boolean isMuMessage()
      Specified by:
      isMuMessage in interface LTV
      Returns:
      true if the message is a multiuser message
    • getMessageId

      public int getMessageId()
      Specified by:
      getMessageId in interface LTV
      Returns:
      message id, used to match this message with its response from Packet Tracer its value is arbitrary unless (hasResponse() == true OR isResponse() == true)
    • getNextMessageId

      public static int getNextMessageId()
      Returns:
      int - next IPC message ID